package com.lieve.serviceb.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * 配置命令： curl -X POST "http://127.0.0.1:8848/nacos/v1/cs/configs?dataId=nacos-service.properties&group=DEFAULT_GROUP&content=useLocalCache=false"
 * @author sunlijiang
 * @date 2020/2/25
 */
@RestController
@RequestMapping("/config")
@RefreshScope
public class ConfigContoller {

    @Value("${useLocalCache:false}")
    private boolean useLocalCache;

    @Value("${initValue:3}")
    private int initValue;

    @RequestMapping("/get")
    public String get() {
        return useLocalCache + " " + initValue;
    }



}


